package org.flexharmony.eclipse.domain;

import java.util.ArrayList;
import java.util.List;


public abstract class Filter
{
  public final String name;
  
  public final boolean defaultAll;

  public final List<String> patterns;
  
  public final IncludedSourceFolder parent;
  
  public Filter(String name, boolean defaultAll, List<String> patterns, IncludedSourceFolder parent)
  {
    this.name = name;
    this.defaultAll = defaultAll;
    this.patterns = (patterns == null) ? new ArrayList<String>() : patterns;
    this.parent = parent;
  }
  
  public String toString()
  {
    String str = name + ":";
    
    if (patterns.size() == 0)
    {
      str += "(" + (defaultAll ? "All" : "None") + ")";
    }
    else
    {
      for (int i = 0; i < patterns.size(); i++)
      {
        if (i != 0) str += ";";
        str += patterns.get(i);
      }
    }
    
    return str;
  }

}
